<!--
**********************************************************
* @Author: 张小平
* @Date:   2024-05-01
* @Email:  qqshuqian@163.com
* @Last modified: 最后修改日期
* @Description: 文件描述
**********************************************************
-->
<template>

    <el-carousel indicator-position="outside" ref="carousel" @click.native="linkTo">
        <el-carousel-item v-for="item in filterList" :key="item" >
            <img :src="item.img">
            <h3>{{ item.txt }}</h3>

        </el-carousel-item>
    </el-carousel>

</template>

<script>
    import router from '@/framework-core/router/'
    export default {
        name: 'Jrcarousel',
        props: {
            items: {
                default: () => {
                    return []
                }
            }
       },
        computed: {

            filterList() {
                const isPcData = (window.innerWidth<800 || window.isMobile)?"0":"1";
                return this.items.filter((params) => {
                    return params.PC == isPcData;
                });
            }
        },
        created(){
          //this.search();
        },
        methods: {
            linkTo () {
                let activeIndex = this.$refs.carousel.activeIndex
                router.push(this.items[activeIndex].link)
            }
        }
    }
</script>


<style lang="scss" scoped>
    .content {
        background: #f7f7f7;
        padding: 5px 10px;
        > ul {
            padding: 0 !important;
            li {
                list-style: none;
                span {
                    color: #409eff;
                }
            }
        }
    }
</style>
